﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:n="http://nRoute/schemas/2010/xaml"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
    xmlns:local_Controls="clr-namespace:nRoute.Samples.Netflix.Controls" 
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
	x:Class="nRoute.Samples.Netflix.Views.TitlesListingView" 
    mc:Ignorable="d"
    d:DesignWidth="780" d:DesignHeight="480">
	
	<UserControl.Resources>
		<Storyboard x:Key="OnLoaded1">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
        		<EasingDoubleKeyFrame KeyTime="0:0:1.4" Value="0">
        			<EasingDoubleKeyFrame.EasingFunction>
        				<CircleEase EasingMode="EaseOut"/>
        			</EasingDoubleKeyFrame.EasingFunction>
        		</EasingDoubleKeyFrame>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource OnLoaded1}"/>
		</EventTrigger>
	</UserControl.Triggers>

    <i:Interaction.Behaviors>
        <n:BridgeViewModelBehavior/>
    </i:Interaction.Behaviors>

	<Grid>
    	
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition Height="60"/>
		</Grid.RowDefinitions>	
		
		<ScrollViewer x:Name="LayoutRoot" Padding="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
			ScrollViewer.VerticalScrollBarVisibility="Auto" Style="{StaticResource BorderedScrollViewerStyle}" 
			BorderThickness="0,0,1,0" Margin="0,0,60,0" BorderBrush="#FF81868F">	
		
	    	<ScrollViewer.RenderTransform>
	    		<TransformGroup>
	    			<ScaleTransform/>
	    			<SkewTransform/>
	    			<RotateTransform/>
	    			<TranslateTransform X="50"/>
	    		</TransformGroup>
	    	</ScrollViewer.RenderTransform>
			
			<ItemsControl Padding="0" ItemsSource="{Binding Titles}"
				ItemTemplate="{StaticResource TitleItemTemplate}" 
				ItemsPanel="{StaticResource TitlesPanelTemplate}" Foreground="#FF333333"/>
				
		</ScrollViewer>
		
		<Button Style="{StaticResource ChromeButtonStyle}" HorizontalAlignment="Center" Cursor="Hand"
			Height="26" Margin="-20,0,40,0" Grid.Row="1" VerticalAlignment="Center" Width="26" Background="#00000000">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="Click">
					<n:ExecuteCommandAction ManageEnableState="True" Command="{Binding PreviousPageCommand}"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>		
			<Path Stretch="Fill" Stroke="#FF8D8D8D" RenderTransformOrigin="0.5,0.5" StrokeThickness="1"				
				Data="M137.5,70 C137.5,107.27922 107.27922,137.5 70,137.5 32.720779,137.5 2.5,107.27922 2.5,70 2.5,32.720779 32.720779,2.5 70,2.5 107.27922,2.5 137.5,32.720779 137.5,70 z M60.451568,38.274979 L94.605912,75.761454 M93.356363,71.59629 L57.535953,106.16715">
				<Path.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="1" ScaleX="-1"/>
						<SkewTransform AngleY="0" AngleX="0"/>
						<RotateTransform Angle="0"/>
						<TranslateTransform/>
					</TransformGroup>
				</Path.RenderTransform>
			</Path>		
		</Button>
		<Button Style="{StaticResource ChromeButtonStyle}" HorizontalAlignment="Center" Cursor="Hand"
			Height="26" Margin="20,0" Grid.Row="1" VerticalAlignment="Center" Width="26" Background="#00000000">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="Click">
					<n:ExecuteCommandAction ManageEnableState="True" Command="{Binding NextPageCommand}"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<Path Stretch="Fill" Stroke="#FF8D8D8D" RenderTransformOrigin="0.5,0.5" StrokeThickness="1"
				Data="M137.5,70 C137.5,107.27922 107.27922,137.5 70,137.5 32.720779,137.5 2.5,107.27922 2.5,70 2.5,32.720779 32.720779,2.5 70,2.5 107.27922,2.5 137.5,32.720779 137.5,70 z M60.451568,38.274979 L94.605912,75.761454 M93.356363,71.59629 L57.535953,106.16715"/>
		</Button>				
		
		<TextBlock TextWrapping="Wrap" Text="{Binding CurrentPageIndex, StringFormat=Page \{0\}}"
			FontFamily="Segoe UI Light" Foreground="#FF8D8D8D" Grid.Row="1" VerticalAlignment="Center" 
			FontSize="16" Margin="8,0" HorizontalAlignment="Left"/>
		<TextBlock TextWrapping="Wrap" Text="{Binding TotalTitlesCount, StringFormat=' \{0\} Titles'}"
			FontFamily="Segoe UI Light" Foreground="#FF8D8D8D" Grid.Row="1" VerticalAlignment="Center" 
			FontSize="16" Margin="8,0,60,0" HorizontalAlignment="Right"/>
			
		<local_Controls:WorkingIndicator IsWorking="{Binding IsLoading}" Grid.RowSpan="2" Margin="0,0,0,0" d:IsHidden="True"/>
		
	</Grid>
    
</UserControl>
